package cn.wolfcode.shop.cloud.common;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

public class CommonControllerAdvice {
    @ExceptionHandler(BusinessException.class)
    @ResponseBody
    public Result handlder(BusinessException ex){
       ex.printStackTrace();
       return  Result.error(ex.getCodeMsg());

    }
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result handlderCommon(Exception ex){
        ex.printStackTrace();
        return  Result.defaultError();

    }
}
